<template>
  <div class="affiliation-page-bottom-bottom">
    <block class="block" title="Affiliation's Latest Publication">
      <div class="content">
        <article-item v-for="article in articles" :key="article.articleId" :article="article" ></article-item>
      </div>
      <div class="line"></div>
      <div class="view-more">
        <div v-if="bigQuantity">
          <a v-if="showAll" href="javascript:void(0)" class="regular-link" @click="changeShowAll">
            View Less
          </a>
          <a v-else href="javascript:void(0)" class="regular-link" @click="changeShowAll">
            View all Publications
          </a>
        </div>
      </div>
    </block>
  </div>
</template>

<script>
import Block from '@/components/Block/AffiliationPageBlock';
import ArticleItem from '@/components/ArticleItem/AuthorArticleItem';

export default {
  name: "BottomBottom",
  props: {
    msg: {
      articles: []
    }
  },
  data() {
    return {
      bigQuantity: false,
      showAll: false
    };
  },
  computed: {
    articles() {
      return [this.msg.articles];
    }
  },
  methods: {
    changeShowAll (){
      this.showAll = !this.showAll;
    }
  },
  components: {
    Block,
    ArticleItem
  },
};
</script>

<style scoped lang="scss">
.affiliation-page-bottom-bottom {
  >.block {
    >.content {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-row-gap: 6px;

      @media screen and (max-width: 1280px){
        grid-template-columns: repeat(2, 1fr);
      }

      @media screen and (max-width: 850px) {
        grid-template-columns: repeat(1, 1fr);
      }

      >* {
        padding: 10px;
        @media screen and (max-width: 850px) {
          padding: 10px 20px;
        }
      }
    }
    >.view-more>div {
      display: flex;
      justify-content: flex-end;
      padding: 10px 0;
      transition: ease-in-out .25s;
      >a {
        margin-right: 30px;
      }
    }
  }
}
</style>
